package com.ddx.convert;

import com.ddx.dto.ShoppingProductVo;
import com.ddx.pojo.ShoppingProduct;

/**
 * @author: liyuxiang
 * @create: 2019-01-21
 */
public class ProductConverter implements Converter<ShoppingProductVo,ShoppingProduct> {

    @Override
    public ShoppingProduct convert(ShoppingProductVo productVo) {
        ShoppingProduct product = new ShoppingProduct();
        product.setId(productVo.getId());
        product.setTitle(productVo.getTitle());
        product.setPicture(productVo.getPicture());
        product.setPrice(productVo.getPrice());
        product.setNowPrice(productVo.getNowPrice());
        product.setStock(productVo.getStock());
        product.setFreightPrice(productVo.getFreightPrice());
        product.setProductHtml(productVo.getProductHtml());
        product.setImages(productVo.getImages());
        product.setShopId(productVo.getShopId());
        product.setStatus(productVo.getStatus());
        return product;
    }
}
